#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc,const char*argv[])
{
	int p=-1;
	if((p=open(argv[1],O_RDWR))==-1){perror("打开失败\n");return -1;}
	printf("大小为%ld\n",lseek(p,0,SEEK_END));
	int n=0;
	lseek(p,2,SEEK_SET);
	read(p,&n,4);
	lseek(p,54,SEEK_SET);
	printf("大小为:%d\n",n);
	unsigned char arr[3]={255,255,0};
	for(int i=0;i<300;i++)
	{
		for(int n=0;n<560;n++)
			write(p,arr,3);
	}
	close(p);
	return 0;
}
